﻿@model IEnumerable<GUI.Models.AdminModels.ArticleModelAdmin>

@{
    ViewBag.Title = "GetArticles";
}

<h2>GetArticles</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
 <tr>
        <th>
            @Html.DisplayNameFor(model => model.CreationDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.UpdateDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.IsActive)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ArticleContenent)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ImageUrl)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.AuteurId)
        </th>
        <th></th>
    </tr>
<table>
   

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CreationDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UpdateDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @{
           
            if (@item.IsActive == false)
            {
                <img src="~/Images/kodown.png" />
            }
            
            else
            {
            <img src="~/Images/upOk.png" />
            }
            }
          @*  @Html.DisplayFor(modelItem => item.IsActive)*@
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ArticleContenent)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ImageUrl)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.AuteurId)
          
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
